package com.example.springboot.service;

import com.example.springboot.entity.Companies;
import com.example.springboot.entity.jobs;
import com.example.springboot.mapper.JobMangerMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class JobMangerService {

    @Autowired
    private JobMangerMapper jobMangerMapper;


    public List<jobs> findAll() {
        return jobMangerMapper.findAll();
    }

    public List<jobs> selectByTitle(String job_title) {
        return jobMangerMapper.selectByTitle(job_title);
    }

    public List<Companies> selectByCompany_id(int company_id) {
        return jobMangerMapper.selectByCompany_id(company_id);
    }

    public void editUserByJob_id(jobs jobs) {
        jobMangerMapper.editUserByJob_id(jobs);
    }

    public void deleteJob(int job_id) {
        jobMangerMapper.deleteJobA(job_id);
        jobMangerMapper.deleteJob(job_id);
    }


    public void deleteJobBatch(List<Long> ids) {
        jobMangerMapper.deleteJobBatchA(ids);
        jobMangerMapper.deleteJobBatch(ids);
    }
}
